<admintpl file="header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">会员卡列表</a></li>
        <li><a href="{:U('add')}">新增卡</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('lists')}">
        手机号：
        <input type="text" name="phone" style="width: 120px;" value="{$formget.phone}" placeholder="">
        会员名：
        <input type="text" name="parent" style="width: 120px;" value="{$formget.parent}" placeholder="">

        <input type="submit" style="margin-left: 5px;" class="btn btn-primary" value="搜索"/>
    </form>


    <a href="{:U('member_add')}"  class="btn btn-primary" >导入会员</a>

    <table style="margin-top: 10px;word-break:break-all;" class="table table-hover table-bordered table-list"
           id="menus-table">
        <thead>
        <tr>
            <th>序号</th>
            <th>用户openid</th>
            <th>用户昵称</th>
            <th>会员名字</th>
            <th>用户手机号</th>
            <th>次数/有效天数</th>
            <th>卡类型</th>
            <th>剩余次数</th>
            <th>截止日期</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo" key="k">
            <tr>
                <td>{$k}</td>
                <td>{$vo.openid} </td>
                <td> {$vo.nickname}</td>
                <td> {$vo.parent}</td>
                <td>{$vo.phone}</td>
                <td>
                    {$vo.number}
                </td>
                <td>
                    <if condition="$vo['type'] eq 'times'">
                        次数卡
                        <else/>
                        时长卡
                    </if>
                </td>
                <td>
                    {$vo.times}

                </if></td>
                <td>{$vo.end_time}</td>

                <td><a href="{:U('edit', ['id' => $vo['id']])}">编辑</a> | <a href="{:U('record', ['phone' => $vo['phone']])}">打卡记录</a>
                    <!--| <a class="js-ajax-delete" href="{:U('del', ['id' => $vo['id']])}">删除</a>-->
                    <if condition="$vo['type'] eq 'times'">
                        | <a class="js-ajax-dialog-btn" href="{:U('signCard', ['id' => $vo['id'], 'tag' => 'swim'])}">游泳打卡</a>
                        | <a class="js-ajax-dialog-btn" href="{:U('signCard', ['id' => $vo['id'], 'tag' => 'shower'])}">洗澡打卡</a>
                    </if>
                </td>
            </tr>
        </volist>
        </tbody>
    </table>
    <div class="pagination">{$Page}</div>
</div>

    <script src="__PUBLIC__/js/common.js"></script>
    <script>
        $(".hidden").hide();
        $('.add_ext').click(function () {
            var name = $(this).attr("name");
            var id = $(this).attr("tid");
            var sort = $(this).attr("sort");

            $(".id").val(id);
            // $("#id").val(id);
            $("#name").val(name);
            $("#sort").val (sort);
        });

    </script>
</body>
</html>